﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows;
using System.Globalization;
using StarryEdge.WPF.Lang;

namespace StarryEdge.Menu.User.Converter
{
    [ValueConversion(typeof(bool), typeof(string))]
    public class BoolToTextConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value == null
                ? LangManager.Instance.Lang["NotEnabled"]
                : System.Convert.ToBoolean(value) ? LangManager.Instance.Lang["Enabled"] : LangManager.Instance.Lang["NotEnabled"];
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
